package com.qianfeng.propertygroup.vo;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.PageInfo;
import com.qianfeng.propertygroup.constants.ResultCode;
import com.qianfeng.propertygroup.pojo.User;

/***
 *
 *   █████▒█    ██  ▄████▄   ██ ▄█▀       ██████╗ ██╗   ██╗ ██████╗
 * ▓██   ▒ ██  ▓██▒▒██▀ ▀█   ██▄█▒        ██╔══██╗██║   ██║██╔════╝
 * ▒████ ░▓██  ▒██░▒▓█    ▄ ▓███▄░        ██████╔╝██║   ██║██║  ███╗
 * ░▓█▒  ░▓▓█  ░██░▒▓▓▄ ▄██▒▓██ █▄        ██╔══██╗██║   ██║██║   ██║
 * ░▒█░   ▒▒█████▓ ▒ ▓███▀ ░▒██▒ █▄       ██████╔╝╚██████╔╝╚██████╔╝
 *  ▒ ░   ░▒▓▒ ▒ ▒ ░ ░▒ ▒  ░▒ ▒▒ ▓▒       ╚═════╝  ╚═════╝  ╚═════╝
 *  ░     ░░▒░ ░ ░   ░  ▒   ░ ░▒ ▒░
 *  ░ ░    ░░░ ░ ░ ░        ░ ░░ ░
 *           ░     ░ ░      ░  
 * Created with IntelliJ IDEA.
 * User: DELL
 * Date: 2020/12/21
 * Time: 20:51
 */
public class R {
    private String msg;
    private int code;
    private Object result;


    public static R setOK(Object data) {
        R result = new R();
        result.setMsg("success");
        result.setCode(ResultCode.SUCCESS);
        result.setResult(data);
        return result;
    }

    public static R SetError(Object data) {
        R result = new R();
        result.setMsg("error");
        result.setCode(ResultCode.ERROR);
        result.setResult(data);
        return result;
    }

    public static R SetError(Object data, String msg, int code) {
        R result = new R();
        result.setMsg(msg);
        result.setCode(code);
        result.setResult(data);
        return result;
    }



    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

}
